/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Controller;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

/**
 *
 * @author iron
 */
public class HibernateUtil {  
    private static SessionFactory sessionFactory;  
      
    //COnfigura um objeto do tipo SessionFactory que irá prover todos os objetos de Sessão (Session)  
    public SessionFactory setUp(){  
        return new Configuration().configure().buildSessionFactory();         
    }  
      
    //Obtem a SessionFactory  
    public SessionFactory getSessionFactory(){  
        return this.sessionFactory = setUp();  
    }  
}  